﻿using Core.Common.DomainModel.Interfaces.Repository;
using Core.Common.DomainModel.Interfaces.Service;
using Core.Common.Repository;
using Core.Common.Service;
using Microsoft.Practices.Unity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.Common.IoC
{
    public class ContainerConfig
    {
        #region [-- Constructors and properties --]


        private static IUnityContainer _container;

        public static IUnityContainer Container
        {
            get
            {
                if (_container == null)
                {
                    _container = new UnityContainer();
                    RegisterTypes();
                }
                return _container;
            }
        }

        #endregion

        static void RegisterTypes()
        {
            _container.RegisterType<IUserService, UserService>();
            _container.RegisterType<IUserRepository, UserRepository>();

        }
    }
}
